package com.imu.purse.modules.trade.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import com.imu.common.validator.group.UpdateGroup;
import com.imu.core.base.BaseEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;


/**
 * 交易明细
 * 
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2018-03-22 10:33:20
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
@Data
@Table(name = "imu_trade_info")
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
public class TradeInfoEntity extends BaseEntity
{
	private static final long serialVersionUID = 1L;

	//主键ID
	@Id
	@Column(name="id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NotNull(message="主键不存在无法更新", groups = {UpdateGroup.class})
	private Long id;

	//付款用户
	@Column(name="pay_user_id")
	private Long payUserId;

	//收款用户
	@Column(name="rec_user_id")
	private Long recUserId;

	//订单号
	@Column(name="order_no")
	private String orderNo;

	//订单类型
	@Column(name="order_type")
	private Integer orderType;

	//状态 0 支付中 1 成功 -1失败
	@Column(name="order_state")
	private Integer orderState;

	//交易余额
	@Column(name="money")
	private BigDecimal money;

	//交易时间
	@Column(name="order_create")
	private Date orderCreate;

	//描述详情
	@Column(name="detail")
	private String detail;

	/**
	 * 交易ID
	 */
	@Column(name = "trans_id")
	private String transId;
	/**
	 * 收款人地址
	 */
	@Column(name = "rec_addr")
	private String recAddr;

	/**
	 * 接受人手机号码
	 */
	@Column(name = "rec_phone")
	private String recPhone;

	/**
	 * 交易费用
	 */
	@Column(name = "fee")
	private BigDecimal fee;

	@Column(name = "origin_type")
	private Integer originType;

	@Column(name = "total_money")
	private BigDecimal totalMoney;

	@Column(name = "imu_to_rmb")
	private BigDecimal imuToRmb;

	@Column(name = "gb_to_rmb")
	private BigDecimal gbToRmb;

	@Column(name = "need_money")
	private BigDecimal needMoney;

	@Column(name = "pay_type")
	private Integer payType;

	@Column(name = "pay_money")
	private BigDecimal payMoney;

	@Column(name = "ytf_type")
	private Integer ytfType;


	//修改前金额
	@Column(name = "smoney")
	private BigDecimal smoney;

	//修改后金额
	@Column(name = "emoney")
	private BigDecimal emoney;
	/**
	 * 开始时间
	 */
	@Transient
	private Date startTime;

	/**
	 * 结束时间
	 */
	@Transient
	private Date endTime;

	@Transient
	private String phone;

	//交易秒数
	@Transient
	private Long transTime;

	@Transient
	private String equalsf;
}
